package com.example.aboutwork.enumhandle;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("enum/test/")
public class TestController {

    private final WokeScheduleMapper mapper;

    int addNum;
    int getNum;

    @GetMapping("add")
    public Boolean add() {
        addNum++;
        WorkSchedule workSchedule = new WorkSchedule().setId(addNum).setWorkTimeType(WorkTimeType.DAY);
        mapper.insert(workSchedule);
        return Boolean.TRUE;
    }

    @GetMapping("get")
    public WorkSchedule get() {
        getNum++;
        return mapper.selectById(getNum);
    }


}
